package com.googlecode.sc2dm.manifest.generator.datastore;

import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyService;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author Jarle Hansen (jarle@jarlehansen.net)
 * Created: 7:49 PM - 9/27/11
 */
public class UserStatsDaoImpl implements UserStatsDao {
    private static final SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss,SSS - yyyy");

    static {
        ObjectifyService.register(UserStats.class);
    }

    public void storeStats(String packageName) {
        UserStats userStats = new UserStats(format.format(new Date()), packageName);

        Objectify objectify = ObjectifyService.begin();
        objectify.put(userStats);
    }

}
